home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / diverses / cexpress / keyboard / mousestp.asm < prev    next >
Encoding:
Assembly Source File  |  1989-05-03  |  973 b   |  41 lines

  1. ;void  mouse_steps(vertical_steps,horizontal_steps);
  2. ;  unsigned short  *vertical_steps,*horizontal_steps;
  3.  
  4.     EXTRN  _memory_model:byte
  5.  
  6. _TEXT    SEGMENT BYTE PUBLIC 'CODE'
  7.     ASSUME CS:_TEXT
  8.     PUBLIC _mouse_steps
  9. _mouse_steps proc near
  10.     push bp            ;
  11.     mov  bp,sp        ;
  12.     push di            ;
  13.     cmp  _memory_model,0    ;near or far?
  14.     jle  begin        ;jump if near
  15.     inc  bp            ;else add 2 to BP
  16.     inc  bp            ;
  17. begin:    mov  ax,11        ;function number
  18.     int  33h        ;get the value
  19.     cmp  _memory_model,2    ;data near or far?
  20.     jb   L1            ;jump if near
  21.     les  di,dword ptr[bp+4] ;point ES:DI to Horizontal
  22.     mov  es:[di],dx        ;
  23.     les  di,dword ptr[bp+8] ;point ES:DI to Vertical
  24.     mov  es:[di],cx        ;
  25.     jmp  short L2        ;
  26. L1:    mov  ax,ds        ;NEAR case
  27.     mov  es,ax        ;
  28.     mov  di,[bp+4]        ;
  29.     mov  es:[di],dx        ;
  30.     mov  di,[bp+6]        ;
  31.     mov  es:[di],cx        ;
  32. L2:    pop  di            ;
  33.     pop  bp            ;
  34.     cmp  _memory_model,0    ;quit
  35.     jle  quit        ;
  36.     db   0CBh        ;RET far
  37. quit:    ret            ;RET near
  38. _mouse_steps ENDP
  39. _TEXT    ENDS
  40.     END
  41.